package com.cj.picturebackend.exception;

/**
 * 异常处理工具类
 * @author cc
 * @date 2025-04-06 20:43
 **/

public class ThrowUtils {

    public static void throwIf(boolean condition,RuntimeException exception){
        if (condition){
            throw exception;
        }
    }



    public static void throwIf(boolean condition,ErrorCode errorCode){
        throwIf(condition,new BusinessException(errorCode));
    }


    public static void throwIf(boolean condition,ErrorCode errorCode,String message){
        throwIf(condition,new BusinessException(errorCode,message));
    }


}
